home *** CD-ROM | disk | FTP | other *** search
- head 1.1;
- branch ;
- access ;
- symbols ;
- locks ;
- comment @ * @;
-
-
- 1.1
- date 92.02.09.19.33.02; author death; state Exp;
- branches ;
- next ;
-
-
- desc
- @this file will, as time goes on, accumulate various functions that I seem to always
- be wanting (e.g. a function that determines if a given number is even or odd).
- @
-
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // This function takes an unsigned number, and returns YES if the number is
- // even, and NO otherwise.
- // This test is accomplished simply by getting the remainder of dividing the number
- // by 2. This remainder will always be either 0 or 1. If it is 1, then theNum was
- // odd, otherwise it was even.
- // This function is included here because this is occasionally a thing I need to make
- // use of, but alas I always end up spending too much time remembering the operators
- // needed to do it again.
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- BOOL EvenUnsignedNum (unsigned long int theNum)
- {
- if ((theNum % 2) == 1)
- return NO;
- else
- return YES;
- }@
-